﻿/**
 * 
 * @file FITKAcousticsAbsMaterial.h
 * @brief  声学材料抽象类定义
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-10-08
 * 
 */
#ifndef __FITKACOUSTICSABSTRACT_MATERIAL_H___
#define __FITKACOUSTICSABSTRACT_MATERIAL_H___
 
#include "FITK_Interface/FITKInterfacePhysics/FITKAbstractMaterial.h"
#include "FITKAcousticsPhysicsAPI.h"

namespace Acoustics
{
    /**
     * @brief 声学材料抽象类定义
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-08
     */
    class  FITKAcousticsPhysicsAPI FITKAcousticsAbsMaterial : public 
        Interface::FITKAbstractMaterial
    {
        Q_OBJECT;
    public:
        /**
         * @brief 声学材料类型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-08
         */
        enum AcousticsMaterialType
        {
            None,              ///< 空
            Fluid,             ///< 流体
            ISOSolid,          ///< 各向同性固体
            ViscoElastic,      ///< 粘弹性
            Foam,              ///< 泡沫
            Fiber,             ///< 纤维
            FEMaterial,        ///< FE材料
        };
        Q_ENUM(AcousticsMaterialType);
    public:
        /**
         * @brief Construct a new FITKAcousticsAbsMaterial object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-08
         */
        explicit FITKAcousticsAbsMaterial() = default;
        /**
         * @brief Destroy the FITKAcousticsAbsMaterial object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-08
         */
        virtual ~FITKAcousticsAbsMaterial() = 0;
        /**
         * @brief 获取声学材料类型
         * @return AcousticsMaterialType 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-08
         */
        virtual AcousticsMaterialType getAcousticsMaterialType() = 0;

        /**
        * @brief 获取密度
        * @return double 密度
        * @author XingXuanCi (xingxuanci@diso.cn)
        * @date 2024-09-29
        */
        double getDensity() const;
        /**
        * @brief 设置密度
        * @param[i] density 密度
        * @author XingXuanCi (xingxuanci@diso.cn)
        * @date 2024-09-29
        */
        void setDensity(const double& density);
        /**
        * @brief 复制数据对象,深拷贝，数据id不拷贝
        * @param[i] obj 被拷贝的对象
        * @return 是否执行成功
        * @author XingXuanCi (xingxuanci@diso.cn)
        * @date 2024-11-15
        */
        virtual bool copy(FITKAbstractDataObject* obj) override;
        /**
         * @brief    更新颜色-具有颜色的材料会更新
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-20
         */
        virtual void updateDefaultColor();

    protected:
        /**
        * @brief  材料密度
        * @author XingXuanCi (xingxuanci@diso.cn)
        * @date   2024-09-29
        */
        double _density{ 0.0 };
    };

    /**
     * @brief 声学材料管理器
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-08
     */
    class FITKAcousticsPhysicsAPI FITKAcousticsMaterialManager : public
        Interface::FITKMaterialManager
    {
        FITKCLASS(Acoustics, FITKAcousticsMaterialManager);
    public:
        /**
         * @brief Construct a new FITKAcousticsMaterialManager object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-08
         */
        explicit FITKAcousticsMaterialManager() = default;
        /**
         * @brief Destroy the FITKAcousticsMaterialManager object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-08
         */
        virtual ~FITKAcousticsMaterialManager() = default;

        /**
         * @brief 根据材料类型获取材料列表
         * @param[i]  t          材料类型
         * @return QList<FITKAcousticsAbsMaterial*> 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-08
         */
        QList<FITKAcousticsAbsMaterial*> getAcousticsMaterials(FITKAcousticsAbsMaterial::AcousticsMaterialType t);
    };
}


#endif
